import request from "@/config/request";

export const get_sp_related_files = (formData) => {
  return request({
    url: "/get_sp_related_files",
    method: "POST",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

export const get_mc_sp_related_files = (formData) => {
  return request({
    url: "/get_mc_sp_related_files",
    method: "POST",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

export const huada_config_upload = (formData) => {
  return request({
    url: "/huada_config_upload",
    method: "POST",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

export const huada_config_upload_pre = (formData) => {
  return request({
    url: "/huada_config_upload_pre",
    method: "POST",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

export const huada_config_upload1 = (data) => {
  return request({
    url: "/huada_config_upload1",
    method: "POST",
    data: data,
    headers: {
      "Content-Type": "application/json", // 确保后端可以解析 JSON 数据
    },
  });
};

export const huada_config_upload2 = (formData) => {
  return request({
    url: "/huada_config_upload2",
    method: "POST",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

export const reCircuitName = (data) => {
  return request.put("/try_update_one_circuit_diagram_name", data);
};

export const getUploadFiles = (params) => {
  return request({
    url: "/try_get_one_huada_config",
    method: "GET",
    params: params,
    headers: {
      "Content-Type": "application/json", // 确保后端可以解析 JSON 数据
    },
  });
};
